package com.labor_management_system.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.labor_management_system.Entity.Project;
import com.labor_management_system.Entity.ProjectList;
import com.labor_management_system.Mapper.ProjectListMapper;
import com.labor_management_system.Mapper.ProjectMapper;
import com.labor_management_system.Mapper.TeamMapper;
import com.labor_management_system.Service.UnionService;
import org.springframework.beans.factory.annotation.Autowired;

public class UnionServiceImpl implements UnionService {
    @Autowired
    private ProjectMapper projectMapper;

    @Autowired
    private ProjectListMapper projectListMapper;
    @Autowired
    private TeamMapper teamMapper;
    @Override
    public void deleteProject(String projectId) {
        //删除子表
        QueryWrapper<ProjectList> listQueryWrapper = new QueryWrapper<>();
        listQueryWrapper.eq("project_id", projectId);
        projectListMapper.delete(listQueryWrapper);

        //删除父表
        QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("project_id", projectId);
        projectMapper.delete(queryWrapper);
    }



}
